/* 员工管理接口 */
import request from '@/utils/request'

// 获取员工简单列表
export const getEmployeesList = () => request({
  method: 'GET',
  url: '/sys/user/simple'
})
// 获取员工列表
export const getEmployees = (params) => request({
  method: 'GET',
  url: '/sys/user',
  params
})
// 根据ID删除员工
export const deleteEmployeeId = (id) => request({
  method: 'DELETE',
  url: `/sys/user/${id}`
})
// 新增员工接口
export const addEmployee = (data) => request({
  method: 'POST',
  url: '/sys/user',
  data
})
// 批量导入员工
export const addEmployeeBatch = (data) => request({
  method: 'POST',
  url: '/sys/user/batch',
  data
})
// 获取员工个人信息
export const getEmployeeInfo = (id) => request({
  method: 'GET',
  url: `/sys/user/${id}`
})
// 修改员工信息
export const saveEmployeById = (data) => request({
  method: 'PUT',
  url: `/sys/user/${data.id}`,
  data
})
// 获取员工岗位信息
export const getEmployeeInfoBasic = (id) => request({
  method: 'GET',
  url: `/employees/${id}/jobs`
})
// 给员工分配角色 
export const assignEmployee = (data) => request({
  method: 'PUT',
  url: '/sys/user/assignRoles',
  data
})